const path = require('path');

module.exports = {
  proxy: {
    '/proxy-api': {
      target: 'http://localhost:8081/',
      changeOrigin: true,
      pathRewrite: {
        '^/proxy-api': '',
      },
    },
  },
  entry: 'src/index.jsx',
  publicPath: '/back/',
  plugins: [
    [
      'ice-plugin-fusion',
      {
        themePackage: '@icedesign/theme',
        // 根据配置推导主品牌色
        primaryColor: '#f60',
        // 覆盖 scss 原始变量
        'font-size-body-1': '18px',
      },
    ],
    [
      'ice-plugin-moment-locales',
      {
        locales: ['zh-cn'],
      },
    ],
  ],
  alias: {
    '@': path.resolve(__dirname, './src/'),
  },
  hash: true,
  devServer: {
    historyApiFallback: true,
  },
  minify: true,
  vendor: false,
};
